Ext.define('WebOs.Kernel.PermissionMgr',{
	
	kernel : null,
	
	constructor : function(config) {
		var me = this;
		Ext.apply(me,config);
	},
	
	hasServicePermission : function(service){
		var me = this;
		var serFile = me.kernel.sfs.getOneFileByCondition(function(item,key){
			if(key==service)
				return true;
			return false;
		});
		if(serFile)
			return true;
		return false;
	},
	
	hasActionPermission : function(service,action){
		var me = this;
		var permissionName = service + ':' + action;
		var serFile = me.kernel.sfs.getOneFileByCondition(function(item,key){
			if(key==permissionName)
				return true;
			return false;
		});
		if(serFile)
			return true;
		return false;
	}
});